home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib43
/
mntlib
/
memccpy.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-26
|
476b
|
32 lines
/* from Henry Spencer's stringlib */
#include <stddef.h>
#include <string.h>
/*
* memccpy - copy bytes up to a certain char
*/
void *
memccpy(dst, src, ucharstop, size)
void * dst;
const void * src;
int ucharstop;
size_t size;
{
register char *d;
register const char *s;
register size_t n;
if (size == 0)
return(NULL);
s = (const char *) src;
d = (char *)dst;
for (n = size; n > 0; n--)
if ((*d++ = *s++) == (char) ucharstop)
return(d);
return(NULL);
}